<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>怡臣 | 终极平台管理</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/Public/admin/adminlte/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/font-awesome/font-awesome.min.css">
    <!-- Ionicons -->
    <!--link rel="stylesheet" href="/Public/admin/adminlte/plugins/ionicons/ionicons.min.css"-->
    <!-- Theme style -->
    <link rel="stylesheet" href="/Public/admin/adminlte/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="/Public/admin/adminlte/dist/css/skins/_all-skins.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/iCheck/flat/blue.css">
    <!-- Morris chart -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/morris/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/datepicker/datepicker3.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/daterangepicker/daterangepicker.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="/Public/admin/adminlte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="/Public/admin/css/common.css">
	<script src="/Public/admin/adminlte/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="/Public/admin/js/jquery.validate.min.js"></script>
    <script src="/Public/admin/js/jquery.validate.config.js"></script>
    <script src="/Public/admin/js/common.js?v=20170331001"></script>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/Public/admin/adminlte/plugins/html5shiv/html5shiv.min.js"></script>
    <script src="/Public/admin/adminlte/plugins/html5shiv/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a href="" class="logo">
            <span class="logo-mini"><b>怡臣</b></span>
            <span class="logo-lg"><b>怡臣终极平台</b>管理</span>
        </a>
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="/Public/admin/adminlte/dist/img/pingtai-face.png" class="user-image" alt="User Image">
                            <span class="hidden-xs"><?php echo session('manageInfo')['login_name'];?></span>
                        </a>
                    </li>
                    <li class="dropdown notifications-menu">
                        <a href="/Manage/login/loginOut" class="dropdown-toggle">
                            <i class="fa fa-bell-o">退出</i>
                            <span class="label label-warning">~</span>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>


<!-- Left logo -->
<?php
if (session('manageInfo')['account_id'] == 1) { ?>
<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 导航页面 -->
        <ul class="sidebar-menu">
            <li class="treeview <?php if(CONTROLLER_NAME == index): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-dashboard"></i> <span>首页管理</span>
                    <span class="pull-right-container">
                      <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="active"><a href="<?php echo U('manage/index/index');?>"><i class="fa fa-circle-o"></i> 首页</a></li>
                </ul>
            </li>
            <li class="<?php echo CONTROLLER_NAME == 'Weixin' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>微信设置</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == twoDBarcode): ?>active<?php endif; ?>"><a href="<?php echo U('Weixin/twoDBarcode');?>"><i class="fa fa-circle-o"></i> 二维码列表</a></li>
                </ul>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == wxInformation): ?>active<?php endif; ?>">
                        <a href="<?php echo U('Weixin/wxInformation');?>"><i class="fa fa-circle-o"></i> 微信消息模板列表</a>
                    </li>
                </ul>
            </li>
            <li class="<?php echo CONTROLLER_NAME == 'Letter' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>短信管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == index): ?>active<?php endif; ?>"><a href="<?php echo U('Letter/index');?>"><i class="fa fa-circle-o"></i> 短信模板</a></li>
                </ul>
            </li>

            <li class="treeview <?php if(CONTROLLER_NAME == Purchase): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>采购</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == index): ?>active<?php endif; ?>"><a href="<?php echo U('purchase/index');?>"><i class="fa fa-circle-o"></i> 采购单列表</a></li>
                    <li class="<?php if(ACTION_NAME == setup): ?>active<?php endif; ?>"><a href="<?php echo U('purchase/setup');?>"><i class="fa fa-circle-o"></i> 可采购商品配置</a></li>
                    <li class="<?php if(ACTION_NAME == stores or ACTION_NAME == store_setup): ?>active<?php endif; ?>"><a href="<?php echo U('purchase/stores');?>"><i class="fa fa-circle-o"></i> 店铺可采购商品配置</a></li>
                </ul>
            </li>
            <li class="treeview <?php if(CONTROLLER_NAME == Vendor): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>供应商</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == index): ?>active<?php endif; ?>"><a href="<?php echo U('manage/vendor/index');?>"><i class="fa fa-circle-o"></i>供应商档案</a></li>
                </ul>
            </li>
            <li class="treeview <?php if(CONTROLLER_NAME == Goods or CONTROLLER_NAME == GoodsCat): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-laptop"></i>
                    <span>商品</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo U('manage/GoodsCat/index');?>"><i class="fa fa-circle-o"></i> 总分类</a></li>
                    <li><a href="<?php echo U('manage/Goods/index');?>" ><i class="fa fa-circle-o"></i> 基础商品库</a></li>
                </ul>
            </li>
            <li class="treeview">
                <a href="javascript:;">
                    <i class="fa fa-edit"></i> <span>订单</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu <?php if(CONTROLLER_NAME == Orders): ?>active<?php endif; ?>">
                    <li><a href="<?php echo U('Orders/orderList');?>"><i class="fa fa-circle-o"></i> 所有订单</a></li>
                </ul>
            </li>
            <li class="treeview <?php if(CONTROLLER_NAME == Special): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-table"></i> <span>营销</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo U('special/index');?>"><i class="fa fa-circle-o"></i> 专题模板</a></li>
                    <li><a href="<?php echo U('Feedback/index');?>"><i class="fa fa-circle-o"></i> 投诉与建议</a></li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="fa fa-calendar"></i> <span>统计</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>                
                </a>
                <ul class="treeview-menu">
                    <li><a href=""><i class="fa fa-circle-o"></i> 销售统计</a></li>
                    <li><a href=""><i class="fa fa-circle-o"></i> 会员统计</a></li>
                    <li><a href=""><i class="fa fa-circle-o"></i> 订单统计</a></li>
                </ul>
            </li>
            <li class="<?php echo CONTROLLER_NAME == 'Rbac' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>权限</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="/manage/rbac/user"><i class="fa fa-circle-o"></i> 帐户</a></li>
                    <li><a href="/manage/rbac/role"><i class="fa fa-circle-o"></i> 角色</a></li>
                    <li><a href="/manage/rbac/menu"><i class="fa fa-circle-o"></i> 菜单</a></li>
                </ul>
            </li>
            <li class="treeview <?php echo (CONTROLLER_NAME == 'Store' or CONTROLLER_NAME == 'Dly') ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-folder"></i> <span>店铺</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="/manage/store/index"><i class="fa fa-circle-o"></i> 店铺管理</a></li>
                    <li><a href="/manage/store/shelves"><i class="fa fa-circle-o"></i> 可上架商品管理</a></li>
                    <li><a href="/manage/Dly/index"><i class="fa fa-circle-o"></i> 店铺物流公司</a></li>
                </ul>
            </li>
            <li class="treeview <?php if(CONTROLLER_NAME == Refund or CONTROLLER_NAME == Feedback): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>售后</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == index): ?>active<?php endif; ?>"><a href="<?php echo U('Refund/index',array('view'=>1));?>"><i class="fa fa-circle-o"></i> 退款退货</a></li>
                    <li class=""><a href=""><i class="fa fa-circle-o"></i> 投诉</a></li>
                </ul>
            </li>
            <li class="treeview">
                <a href="<?php echo U('User/index');?>">
                    <i class="fa fa-share"></i> <span>会员</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo U('User/index');?>"><i class="fa fa-circle-o"></i> 会员列表</a></li>
                    <li><a href="<?php echo U('User/tempUser');?>"><i class="fa fa-circle-o"></i> 游客列表</a></li>
                </ul>
            </li>
            <li class="treeview <?php if(CONTROLLER_NAME == Bonus): ?>active<?php endif; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>奖金</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<?php if(ACTION_NAME == index): ?>active<?php endif; ?>"><a href="<?php echo U('Bonus/index');?>"><i class="fa fa-circle-o"></i>奖金流水列表</a></li>
                </ul>
            </li>
            <li class="header">财务</li>
            <li><a href="<?php echo U('Bills/index');?>"><i class="fa fa-circle-o text-red"></i> <span>店铺结算账单</span></a></li>
            <!--<li><a href="#"><i class="fa fa-circle-o text-yellow"></i> <span>备注2</span></a></li>
            <li><a href="#"><i class="fa fa-circle-o text-aqua"></i> <span>备注3</span></a></li>-->


        </ul>
    </section>
    <!-- /.sidebar -->
</aside>

<?php
}else{ ?>

<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 导航页面 -->
        <ul class="sidebar-menu">

            <?php
 foreach ($nav_menu as $k=>$v) { switch ($k) { case 0: $iClass = 'fa-dashboard'; break; case 1: $iClass = 'fa-th'; break; case 2: $iClass = 'fa-laptop'; break; case 3: $iClass = 'fa-edit'; break; case 4: $iClass = 'fa-table'; break; case 5: $iClass = 'fa-folder'; break; default: $iClass = 'fa-dashboard'; } ?>
            <li class="treeview">
                <a href="#">
                    <i class="fa <?php echo $iClass; ?>"></i> <span><?php echo $v['name'];?></span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <?php
 foreach ($menu as $value) { if($v['id'] == $value['nav_menu_id']) { ?>
                    <li><a href="<?php echo $value['value']; ?>"><i class="fa fa-circle-o"></i> <?php echo $value['name']?></a></li>
                    <?php }} ?>
                </ul>
            </li>
            <?php } ?>
        </ul>
         <script type="text/javascript">
			var curHref = window.location.href.toLowerCase();
			$(".sidebar-menu .treeview-menu a").each(function(){
				if(curHref.indexOf($(this).attr("href").toLowerCase()) != -1){
					$(this).parents(".treeview").addClass("active");
					$(this).parent().addClass("active");
				}	
			});
		</script>
    </section>
    <!-- /.sidebar -->
</aside>
<?php } ?>
<!---时间插件-->
<script type="text/javascript" src="/Public/admin/calendar/calendar.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<?php echo ($ak); ?>"></script>
<link rel="stylesheet" href="/Public/admin/calendar/calendar-blue.css"/>
<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            店铺
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 店铺管理</a></li>
            <li class="active">添加店铺</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content"><div class="row"><div class="col-md-12">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">添加店铺</h3>

                <div class="box-tools">

                    <div class="btn-group pull-right" style="margin-right: 10px">
                        <a href="/manage/store/index" class="btn btn-sm btn-default"><i class="fa fa-list"></i>&nbsp;店铺列表</a>
                    </div>
                </div>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form action="/manage/store/storeAdd" method="post" id="form" class="form-horizontal" pjax-container="">
                <div class="box-body">
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">门店名称</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                <input type="test" name="local_name" value="" class="form-control" placeholder="门店名称">
                            </div>
                        </div>
                    </div>
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">登陆名称</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                <input type="test" name="username" value="" class="form-control" placeholder="登陆名称">
                            </div>
                        </div>
                    </div>
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">登陆密码</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                <input type="password" name="password" value="" class="form-control" placeholder="登陆密码">
                            </div>
                        </div>
                    </div>
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">配送区域</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                <input type="text" name="area_dispatch" value="" class="form-control" placeholder="配送区域">
                            </div>
                        </div>
                    </div>
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">门店类型</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <select name="local_type" class="form-control  select2-hidden-accessible">
                                    <option value="0">自营店</option>
                                    <option value="1">加盟店</option>
                                    <option value="2">租赁店</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">门店编号</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                <input type="text" name="local_number" value="" class="form-control" placeholder="门店编号">
                            </div>
                        </div>
                    </div>
                    <div class="form-group 1">
                        <label class="col-sm-2 control-label">门店营业状态</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                停业 <input type="radio" checked name="local_status" value="0" class="">
                                营业 <input type="radio" name="local_status" value="1" class="">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">门店全称</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="local_full_name" value="" class="form-control" placeholder="门店全称">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">营业开始时间</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" id="business_begintime"  name="business_begintime" class="form-control" value="" placeholder="营业开始时间" />
                        </div>

                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">营业结束时间</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="business_endtime" id="business_endtime" value="" class="form-control" placeholder="营业结束时间">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">负责人</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="principal" value="" class="form-control" placeholder="负责人">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">门店logo</label>
                    <div class="col-sm-6">
                        <input type="file" id="image" data-max-file-count="1" />
                        <input type="hidden" id="image_action"/>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">门店相册</label>
                    <div class="col-sm-6">
                        <input type="file" id="cat_bg_img"  data-max-file-count="1" />
                        <input type="hidden" id="cat_bg_img_action"/>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">地图选取</label>
                    <div class="col-sm-6">
                        <div id="storeMap"   style="display: block; height: 400px;"></div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">所属地区</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="area_text" id="store_district" value="" class="form-control" placeholder="所属地区">
                            <input type="hidden" name="province" id="province" value="<?php echo ($store["province"]); ?>" placeholder="省">
                            <input type="hidden" name="city" id="city" value="<?php echo ($store["city"]); ?>" placeholder="市">
                            <input type="hidden" name="area" id="area" value="<?php echo ($store["area"]); ?>" placeholder="区">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">详细地址</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="addr" id="store_detailed_address" value="" class="form-control" placeholder="详细地址">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">经度</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="store_lnt" id="store_lnt" value="" class="form-control" placeholder="经度" disabled="true">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">维度</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="store_lat" id="store_lat" value="" class="form-control" placeholder="维度" disabled="true">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">电话</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="tel" value="" class="form-control" placeholder="电话">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">手机</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="mobile" value="" class="form-control" placeholder="手机">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">自提备注</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <textarea type="text" name="ziti_remark" class="form-control"><?php echo ($store["ziti_remark"]); ?></textarea>
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">周边配送物流名称</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                            <input type="text" name="myexpress" value="<?php echo C('DEFAULT_EXPRESS');?>" data-default="<?php echo C('DEFAULT_EXPRESS');?>" class="form-control" placeholder="周边配送物流名称">
                        </div>
                    </div>
                </div>
                <div class="form-group 1">
                    <label class="col-sm-2 control-label">店铺是否能自己设置周边物流名称</label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            可以 <input type="radio" checked name="is_byself" value="1" class="">
                            不行 <input type="radio" name="is_byself" value="0" class="">
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <div class="col-sm-2">

                    </div>
                    <div class="col-sm-6">

                        <div class="btn-group pull-left">
                            <button type="submit" id="submit" class="btn btn-info pull-right">保存</button>
                        </div>

                    </div>

                </div>
                <!-- /.box-footer -->
            </form>
        </div>

    </div></div>

    </section>
</div>
<!-- 底部 -->
<!--include file="Public/foot" /-->
<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> 3.0
    </div>
    <strong>Copyright &copy; 2016-2018 <a href="#">怡臣</a>.</strong> All rights
    reserved.
</footer>
</div>
<!-- Bootstrap 3.3.6 -->
<script src="/Public/admin/adminlte/bootstrap/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="/Public/admin/adminlte/dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="/Public/admin/adminlte/dist/js/demo.js"></script>
<script data-exec-on-popstate>
    $('.grid-refresh').click(function () {
        window.location.reload();
    });
    $('.gobackpage').click(function () {
        window.history.back();
    })
</script>
</body>
</html>
<!--上传插件-->
<link rel="stylesheet" href="/Public/admin/fileinput/fileinput.min.css" />
<script src="/Public/admin/fileinput/fileinput.min.js"></script>
<link rel="stylesheet" href="/Public/admin/jedate/jedate.css" />
<script src="/Public/admin/jedate/jedate.js"></script>
<script type="text/javascript">
	// 设置时间
	function setJedate(){
		var start = {
			dateCell: "#business_begintime",
			format: "hh:mm"
		};
		var end = {
			dateCell: "#business_endtime",
			format: "hh:mm"
		};
		jeDate(start);
		jeDate(end);
	}
    $(function () {
		setJedate();
    	// 上传图片js
        $("#image").fileinput({
            overwriteInitial: true,
            dropZoneEnabled: false,
            uploadUrl: '/admin/upload/index/"',
            language: 'zh',
            showRemove: false,
            maxFileCount: 1,
            browseClass: 'btn btn-primary btn-docup',
            showPreview: true,
            uploadClass: 'btn btn-default btn-docup',
            allowedFileTypes: ["image"],
            browseLabel: "添加图片",
            uploadLabel: "上传图片",
        }).on("fileuploaded", function (event, data, previewId, index) {
            var response = data.response;
            if (data.jqXHR.status == 200) {
                // ajax 成功返回数据写入
                $('.file-preview-frame').eq(index).append("<input class='abc' type='hidden' name='local_log[]' value='"+response+"'>");
            }
        });
        $("#image").on('filecleared', function(event) {
            $("#image_action").val(1);
        });


        $("#cat_bg_img").fileinput({
            overwriteInitial: true,
            dropZoneEnabled: false,
            uploadUrl: '/admin/upload/index/"',
            language: 'zh',
            showRemove: false,
            maxFileCount: 1,
            browseClass: 'btn btn-primary btn-docup',
            showPreview: true,
            uploadClass: 'btn btn-default btn-docup',
            allowedFileTypes: ["image"],
            browseLabel: "添加图片",
            uploadLabel: "上传图片",
        }).on("fileuploaded", function (event, data, previewId, index) {
            var response = data.response;
            if (data.jqXHR.status == 200) {
                // ajax 成功返回数据写入
                $('.file-preview-frame').eq(index).append("<input class='abc' type='hidden' name='local_photo[]' value='"+response+"'>");
            }
        });
        $("#cat_bg_img").on('filecleared', function(event) {
            $("#cat_bg_img_action").val(1);
        });

        //  调取百度API
        var map = new BMap.Map("storeMap");
        var markerTmp;
        map.enableScrollWheelZoom(true);
        var lng="",lat="";
        if(lng != '' && lat != ''){
            map.centerAndZoom(new BMap.Point(lng,lat),17);
            var marker = new BMap.Marker(new BMap.Point(lng,lat));  // 创建标注
            markerTmp = marker;
            map.addOverlay(marker); //将标注添加到地图中
        }else{
			map.centerAndZoom('重庆',15); //设置地图元素的可视层
        }
//        _getLocation(lng,lat);
        map.addEventListener("click", function(e) {

            if (markerTmp != '') {
                map.removeOverlay(markerTmp);
            }
            lng = e.point.lng;
            document.getElementById("store_lnt").value = lng;
            lat = e.point.lat;
            document.getElementById("store_lat").value = lat;
            //在地图上面描点
            var marker = new BMap.Marker(new BMap.Point(lng, lat));  // 创建标注
            markerTmp = marker;
            map.addOverlay(marker);
            var gc = new BMap.Geocoder();
            //获取地址的数据地址
            var pt = e.point;
            gc.getLocation(pt, function (rs) {
                var addComp = rs.addressComponents;
                var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
                var site = addComp.province + addComp.city + addComp.district;
                document.getElementById("store_district").value = site;
                document.getElementById("store_detailed_address").value = address;
                document.getElementById("province").value = addComp.province;
                document.getElementById("city").value = addComp.city;
                document.getElementById("area").value = addComp.district;
            });
        });

        $('input[name=is_byself]').on('change', function () {
            if(this.value == '0') {
                var default_name = $('input[name=myexpress]').data('default');
                $('input[name=myexpress]').val(default_name);
            }
        });

        //表单验证
        $("#form").validate({
            rules: {
                local_name:{
                    required: true,
                    rangelength: [2, 50]
                },
                username: {
                    required: true,
                    isUsername: true
                },
                password: {
                    isPassword: true
                },
                mobile: {
                    isMobile: true
                },
                tel:{
                    isPhone: true
                },
                principal:{
                    rangelength: [2, 10]
                },
                business_begintime:{
                    isShopTime: true
                },
                business_endtime:{
                    isShopTime: true,
                    shopTimeBigThan: "#business_begintime"
                },
                ziti_remark:{
                    maxlength: 250
                }
            },
            messages:{
                local_name: {
                    required: "请输入门店名称",
                    rangelength: "门店名称长度在2到50个字符之间"
                },
                username: {
                    required: "请输入登陆名称"
                },
                principal: {
                    rangelength: "负责人长度在2到10个字符之间"
                },
                business_endtime:{
                    shopTimeBigThan: "【注意：】营业结束时间必须大于营业开始时间"
                },
                ziti_remark: {
                    maxlength: "自提备注最多可输入250个字符"
                }
            },
            submitHandler: function(form){
                form.submit();   //提交表单
            }
        });

    });
</script>